package org.lzy.shop.viewmodel.repository

import android.content.Context
import android.net.Uri
import org.lzy.shop.datas.OrderCommentRequest
import org.lzy.shop.datas.OrderRequest
import org.lzy.shop.response.AddressResponse
import org.lzy.shop.response.LogisticsResponse
import org.lzy.shop.response.OrderInfoResponse
import org.lzy.shop.response.OrderRefundReason
import org.lzy.shop.response.OrderResponse
import org.lzy.shop.response.OssUpload

interface OrderRepository {
    // 获取订单列表
    suspend fun getOrderList(orderPresent: OrderRequest): OrderResponse?

    // 取消订单
    suspend fun cancelOrder(orderId: Int, remark: String?): String?

    // 获取订单详情
    suspend fun getOrderInfo(orderId: Int): OrderInfoResponse?

    // 确认收货
    suspend fun confirmOrder(orderId: Int): String?

    // 退款
    suspend fun refundOrder(orderId: Int, reason: String?): Any?

    // 查看物流信息
    suspend fun getLogistics(orderId: Int): LogisticsResponse?

    // 获取默认地址
    suspend fun getDefaultAddress(): AddressResponse?

    // 获得退货理由
    suspend fun getReasonData(): MutableList<OrderRefundReason>?

    // 获取文件上传凭证
    suspend fun getTencentCredentials(): OssUpload?

    // 上传单张图片
    suspend fun uploadImage(context: Context, imageUri: Uri, uploadUrl: String, tmpSecretId: String, tmpSecretKey: String, sessionToken: String): String?

    // 上传多张图片
    suspend fun uploadImages(context: Context, imageUris: List<Uri>, uploadUrl: String, tmpSecretId: String, tmpSecretKey: String, sessionToken: String): List<String>?

    // 提交订单评论
    suspend fun orderComment(request: OrderCommentRequest): Any?
}
